﻿@inherits BaseComponent

<GridCol Span="Span">
    <FormItem Label="@Label" Required="Required" Rules="Rules">
        <CascadingValue Value="this">
            @ChildContent
        </CascadingValue>
    </FormItem>
</GridCol>

@code {
    public Type Type { get; set; } = typeof(string);
    [Parameter] public int Span { get; set; }
    [Parameter] public string Label { get; set; }
    [Parameter] public bool Required { get; set; }
    [Parameter] public FormValidationRule[] Rules { get; set; }
    [Parameter] public RenderFragment ChildContent { get; set; }

    protected override void OnInitialized()
    {
        if (Rules == null)
            Rules = this.ToRules(Context);
        base.OnInitialized();
    }
}